package charts; 

import string.Utils;
import charts.series.dots.DefaultDotProperties;
import charts.Structs.AreaStyleStruct;
import charts.series.Element;

class Scatter extends ScatterBase<DotStyleStruct, Element> {

	var circle_size:Int;

	public function new( json:Dynamic )
	{
		super();

		style = {
			values:			[],
			width:			2,
			colour:			'#3030d0',
			text:			'', // <-- default not display a key
			font_size:		12,
			tip:			'[#x#,#y#] #size#',
			axis:			'left'
		};

		// hack: keep this incase the merge kills it, we'll
		// remove the merge later (and this hack)
		var dot_style:String= json['dot-style'];
		
		Object_helper.merge_2( json, style );
		
		this.default_style = new DefaultDotProperties(
			json['dot-style'], this.style.colour, this.style.axis);
		
		this.line_width = style.width;
		this.colour		= string.Utils.get_colour( style.colour );
		this.key		= style.text;
		this.font_size	= style.font_size;
		this.circle_size = style.dot_size;
		
		for ( val in style.values )
		{
			if( val['dot-size'] == null )
				val['dot-size'] = style.dot_size; // TODO - values in Style, is not a primitive type Float, fix the type
		}
		
		this.values = style.values;

		this.add_values();
	}
}
